import { ref, onMounted ,onBeforeUnmount   } from 'vue'
export default function () {
   
	const desk = ref(false)
    const changeDesk = () => {
         let flag = window.innerWidth > 768; // 设置阈值，这里假设大于等于 768px 的宽度为电脑端
		if(flag){
			desk.value = 'right'
		}else{
			desk.value = false
		}
      }

	onMounted(()=>{
		changeDesk()
		window.addEventListener('resize', changeDesk)
	}) 
    onBeforeUnmount(()=>{
		window.removeEventListener('resize', changeDesk)
	}) 
	return {
		desk
	}
}